package com.fc.v2.movie.actor.model.auto;

import java.util.ArrayList;
import java.util.List;
import cn.hutool.core.util.StrUtil;

/**
 * 演员表，演员信息 LionTestActorExample
 * @author 程冲_自动生成
 * @date 2022-11-26 23:31:00
 */
public class LionTestActorExample {

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public LionTestActorExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }
        
				
        public Criteria andIDIsNull() {
            addCriterion("ID is null");
            return (Criteria) this;
        }

        public Criteria andIDIsNotNull() {
            addCriterion("ID is not null");
            return (Criteria) this;
        }

        public Criteria andIDEqualTo(String value) {
            addCriterion("ID =", value, "iD");
            return (Criteria) this;
        }

        public Criteria andIDNotEqualTo(String value) {
            addCriterion("ID <>", value, "iD");
            return (Criteria) this;
        }

        public Criteria andIDGreaterThan(String value) {
            addCriterion("ID >", value, "iD");
            return (Criteria) this;
        }

        public Criteria andIDGreaterThanOrEqualTo(String value) {
            addCriterion("ID >=", value, "iD");
            return (Criteria) this;
        }

        public Criteria andIDLessThan(String value) {
            addCriterion("ID <", value, "iD");
            return (Criteria) this;
        }

        public Criteria andIDLessThanOrEqualTo(String value) {
            addCriterion("ID <=", value, "iD");
            return (Criteria) this;
        }

        public Criteria andIDLike(String value) {
            addCriterion("ID like", value, "iD");
            return (Criteria) this;
        }

        public Criteria andIDNotLike(String value) {
            addCriterion("ID not like", value, "iD");
            return (Criteria) this;
        }

        public Criteria andIDIn(List<String> values) {
            addCriterion("ID in", values, "iD");
            return (Criteria) this;
        }

        public Criteria andIDNotIn(List<String> values) {
            addCriterion("ID not in", values, "iD");
            return (Criteria) this;
        }

        public Criteria andIDBetween(String value1, String value2) {
            addCriterion("ID between", value1, value2, "iD");
            return (Criteria) this;
        }

        public Criteria andIDNotBetween(String value1, String value2) {
            addCriterion("ID not between", value1, value2, "iD");
            return (Criteria) this;
        }
        
				
        public Criteria andPRODUCTIsNull() {
            addCriterion("PRODUCT is null");
            return (Criteria) this;
        }

        public Criteria andPRODUCTIsNotNull() {
            addCriterion("PRODUCT is not null");
            return (Criteria) this;
        }

        public Criteria andPRODUCTEqualTo(String value) {
            addCriterion("PRODUCT =", value, "pRODUCT");
            return (Criteria) this;
        }

        public Criteria andPRODUCTNotEqualTo(String value) {
            addCriterion("PRODUCT <>", value, "pRODUCT");
            return (Criteria) this;
        }

        public Criteria andPRODUCTGreaterThan(String value) {
            addCriterion("PRODUCT >", value, "pRODUCT");
            return (Criteria) this;
        }

        public Criteria andPRODUCTGreaterThanOrEqualTo(String value) {
            addCriterion("PRODUCT >=", value, "pRODUCT");
            return (Criteria) this;
        }

        public Criteria andPRODUCTLessThan(String value) {
            addCriterion("PRODUCT <", value, "pRODUCT");
            return (Criteria) this;
        }

        public Criteria andPRODUCTLessThanOrEqualTo(String value) {
            addCriterion("PRODUCT <=", value, "pRODUCT");
            return (Criteria) this;
        }

        public Criteria andPRODUCTLike(String value) {
            addCriterion("PRODUCT like", value, "pRODUCT");
            return (Criteria) this;
        }

        public Criteria andPRODUCTNotLike(String value) {
            addCriterion("PRODUCT not like", value, "pRODUCT");
            return (Criteria) this;
        }

        public Criteria andPRODUCTIn(List<String> values) {
            addCriterion("PRODUCT in", values, "pRODUCT");
            return (Criteria) this;
        }

        public Criteria andPRODUCTNotIn(List<String> values) {
            addCriterion("PRODUCT not in", values, "pRODUCT");
            return (Criteria) this;
        }

        public Criteria andPRODUCTBetween(String value1, String value2) {
            addCriterion("PRODUCT between", value1, value2, "pRODUCT");
            return (Criteria) this;
        }

        public Criteria andPRODUCTNotBetween(String value1, String value2) {
            addCriterion("PRODUCT not between", value1, value2, "pRODUCT");
            return (Criteria) this;
        }
        
				
        public Criteria andCOMPANYIsNull() {
            addCriterion("COMPANY is null");
            return (Criteria) this;
        }

        public Criteria andCOMPANYIsNotNull() {
            addCriterion("COMPANY is not null");
            return (Criteria) this;
        }

        public Criteria andCOMPANYEqualTo(String value) {
            addCriterion("COMPANY =", value, "cOMPANY");
            return (Criteria) this;
        }

        public Criteria andCOMPANYNotEqualTo(String value) {
            addCriterion("COMPANY <>", value, "cOMPANY");
            return (Criteria) this;
        }

        public Criteria andCOMPANYGreaterThan(String value) {
            addCriterion("COMPANY >", value, "cOMPANY");
            return (Criteria) this;
        }

        public Criteria andCOMPANYGreaterThanOrEqualTo(String value) {
            addCriterion("COMPANY >=", value, "cOMPANY");
            return (Criteria) this;
        }

        public Criteria andCOMPANYLessThan(String value) {
            addCriterion("COMPANY <", value, "cOMPANY");
            return (Criteria) this;
        }

        public Criteria andCOMPANYLessThanOrEqualTo(String value) {
            addCriterion("COMPANY <=", value, "cOMPANY");
            return (Criteria) this;
        }

        public Criteria andCOMPANYLike(String value) {
            addCriterion("COMPANY like", value, "cOMPANY");
            return (Criteria) this;
        }

        public Criteria andCOMPANYNotLike(String value) {
            addCriterion("COMPANY not like", value, "cOMPANY");
            return (Criteria) this;
        }

        public Criteria andCOMPANYIn(List<String> values) {
            addCriterion("COMPANY in", values, "cOMPANY");
            return (Criteria) this;
        }

        public Criteria andCOMPANYNotIn(List<String> values) {
            addCriterion("COMPANY not in", values, "cOMPANY");
            return (Criteria) this;
        }

        public Criteria andCOMPANYBetween(String value1, String value2) {
            addCriterion("COMPANY between", value1, value2, "cOMPANY");
            return (Criteria) this;
        }

        public Criteria andCOMPANYNotBetween(String value1, String value2) {
            addCriterion("COMPANY not between", value1, value2, "cOMPANY");
            return (Criteria) this;
        }
        
				
        public Criteria andYEARSIsNull() {
            addCriterion("YEARS is null");
            return (Criteria) this;
        }

        public Criteria andYEARSIsNotNull() {
            addCriterion("YEARS is not null");
            return (Criteria) this;
        }

        public Criteria andYEARSEqualTo(Integer value) {
            addCriterion("YEARS =", value, "yEARS");
            return (Criteria) this;
        }

        public Criteria andYEARSNotEqualTo(Integer value) {
            addCriterion("YEARS <>", value, "yEARS");
            return (Criteria) this;
        }

        public Criteria andYEARSGreaterThan(Integer value) {
            addCriterion("YEARS >", value, "yEARS");
            return (Criteria) this;
        }

        public Criteria andYEARSGreaterThanOrEqualTo(Integer value) {
            addCriterion("YEARS >=", value, "yEARS");
            return (Criteria) this;
        }

        public Criteria andYEARSLessThan(Integer value) {
            addCriterion("YEARS <", value, "yEARS");
            return (Criteria) this;
        }

        public Criteria andYEARSLessThanOrEqualTo(Integer value) {
            addCriterion("YEARS <=", value, "yEARS");
            return (Criteria) this;
        }

        public Criteria andYEARSLike(Integer value) {
            addCriterion("YEARS like", value, "yEARS");
            return (Criteria) this;
        }

        public Criteria andYEARSNotLike(Integer value) {
            addCriterion("YEARS not like", value, "yEARS");
            return (Criteria) this;
        }

        public Criteria andYEARSIn(List<Integer> values) {
            addCriterion("YEARS in", values, "yEARS");
            return (Criteria) this;
        }

        public Criteria andYEARSNotIn(List<Integer> values) {
            addCriterion("YEARS not in", values, "yEARS");
            return (Criteria) this;
        }

        public Criteria andYEARSBetween(Integer value1, Integer value2) {
            addCriterion("YEARS between", value1, value2, "yEARS");
            return (Criteria) this;
        }

        public Criteria andYEARSNotBetween(Integer value1, Integer value2) {
            addCriterion("YEARS not between", value1, value2, "yEARS");
            return (Criteria) this;
        }
        
			
		 public Criteria andLikeQuery(LionTestActor record) {
		 	List<String> list= new ArrayList<String>();
		 	List<String> list2= new ArrayList<String>();
        	StringBuffer buffer=new StringBuffer();
			if(record.getId()!=null&&StrUtil.isNotEmpty(record.getId().toString())) {
    			 list.add("ifnull(ID,'')");
    		}
			if(record.getProduct()!=null&&StrUtil.isNotEmpty(record.getProduct().toString())) {
    			 list.add("ifnull(PRODUCT,'')");
    		}
			if(record.getCompany()!=null&&StrUtil.isNotEmpty(record.getCompany().toString())) {
    			 list.add("ifnull(COMPANY,'')");
    		}
			if(record.getYears()!=null&&StrUtil.isNotEmpty(record.getYears().toString())) {
    			 list.add("ifnull(YEARS,'')");
    		}
			if(record.getId()!=null&&StrUtil.isNotEmpty(record.getId().toString())) {
    			list2.add("'%"+record.getId()+"%'");
    		}
			if(record.getProduct()!=null&&StrUtil.isNotEmpty(record.getProduct().toString())) {
    			list2.add("'%"+record.getProduct()+"%'");
    		}
			if(record.getCompany()!=null&&StrUtil.isNotEmpty(record.getCompany().toString())) {
    			list2.add("'%"+record.getCompany()+"%'");
    		}
			if(record.getYears()!=null&&StrUtil.isNotEmpty(record.getYears().toString())) {
    			list2.add("'%"+record.getYears()+"%'");
    		}
        	buffer.append(" CONCAT(");
	        buffer.append(StrUtil.join(",",list));
        	buffer.append(")");
        	buffer.append(" like CONCAT(");
        	buffer.append(StrUtil.join(",",list2));
        	buffer.append(")");
        	if(!" CONCAT() like CONCAT()".equals(buffer.toString())) {
        		addCriterion(buffer.toString());
        	}
        	return (Criteria) this;
        }
        
        public Criteria andLikeQuery2(String searchText) {
		 	List<String> list= new ArrayList<String>();
        	StringBuffer buffer=new StringBuffer();
    		list.add("ifnull(ID,'')");
    		list.add("ifnull(PRODUCT,'')");
    		list.add("ifnull(COMPANY,'')");
    		list.add("ifnull(YEARS,'')");
        	buffer.append(" CONCAT(");
	        buffer.append(StrUtil.join(",",list));
        	buffer.append(")");
        	buffer.append("like '%");
        	buffer.append(searchText);
        	buffer.append("%'");
        	addCriterion(buffer.toString());
        	return (Criteria) this;
        }
        
}
	
    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}